<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="../../../../header.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<style>
#manage-form {
	display: table;
}

.table-row {
	display: table-row;
}

.table-row>* {
	display: table-cell;
	margin-left: 20px;
	margin-top: 5px;
}

table[id="search"] {
	margin: 0 auto;
}

table[id="search"] td {
	height: 30px;
}

table[id="search"] td>* {
	height: 100%;
	width: 100px;
}
</style>
<script type="text/javascript">
	$.ajax({
		type : "POST",
		url : "company",
		success : function(data) {
			var content = data;
			$(".companyname").append(data);
		}
	});
</script>
</head>
<body style="align: center;">
	<div style="width: 100%; height: 100%; display: table;">
		<form id="manage-form" action=""
			style="width: 100%; display: table-cell; vertical-align: middle;">
			<div id="fbox_list" class="searchFilter" style="overflow: auto">
				<table id="search" class="group ui-widget ui-widget-content"
					style="border: 0px none;">
					<tbody>
						<tr class="error" style="display: none;">
							<th colspan="5" class="ui-state-error" align="left"></th>
						</tr>
						<tr>
							<th colspan="5" align="left"><span></span></th>
						</tr>
						<tr>
							<td class="first">公司：</td>
							<td class="columns"><select id="searchField"
								class="companyname" style="width: 140px;">

							</select></td>
						</tr>
						<tr>
							<td class="first">年份：</td>
							<td class="columns"><select id="searchField"
								class="years" style="width: 140px;">
                             <option value="2018">2018</option>
                             <option value="2019">2019</option>
                             <option value="2020">2020</option>
                             <option value="2021">2021</option>
                             <option value="2022">2022</option>
                             <option value="2023">2023</option>
							</select></td>
						</tr>	
					</tbody>
				</table>
			</div>
		</form>
	</div>

	<script type="text/javascript">
		var api = frameElement.api;
		var operate = api.data.operate;
		var rowid = api.data.rowid;
		var rowdata = api.data.rowdata;
		var CallBack = api.data.callback;
		var grid = api.data.grid;
		var companySelect = api.data.mycompany;
		var yearsSelect = api.data.myyears;
		var grid = api.data.grid;
		$(function() {
			initPopBtns();
		})
		function initPopBtns() {
			var btnname = [ "搜索", "取消" ];
			api
					.button(
							{
								id : "confirm",
								name : btnname[0],
								focus : true,
								callback : function(e) {
									var searchField = "qichu";
									var searchOper = "eq";
									var searchString = $(".companyname").val()+"|"+$(".years").val();
									var data = {
										searchField : searchField,
										searchOper : searchOper,
										searchString : searchString
									};
									CallBack(data);
									$(companySelect).val($(".companyname").val());
									$(yearsSelect).val($(".years").val());
									var obj=grid.jqGrid("getRowData");
									 jQuery(obj).each(function(){
										grid.jqGrid('setGridParam',{cellEdit:true});  
										grid.jqGrid('destroyFrozenColumns').trigger('reloadGrid');										 grid.jqGrid('setGridParam',{cellEdit:true});  
										grid.setColProp("holidaysStart",{editable:true});
										grid.setColProp("overTimeDaysStart",{editable:true});  
										grid.setColProp("kpi01",{editable:true});  
										grid.setColProp("kpi02",{editable:true});  
										grid.setColProp("kpi03",{editable:true});  
										grid.setColProp("kpi04",{editable:true});  
										grid.setColProp("kpi05",{editable:true});  
										grid.setColProp("kpi06",{editable:true});  
										grid.setColProp("kpi07",{editable:true});  
										grid.setColProp("kpi08",{editable:true});  
										grid.setColProp("kpi09",{editable:true});  
										grid.setColProp("kpi10",{editable:true});  
										grid.setColProp("kpi11",{editable:true});  
										grid.setColProp("kpi12",{editable:true});  
									    });
								}
							}, {
								id : "cancel",
								name : btnname[1]
							})
		}
	</script>
</body>
</html>